<!DOCTYPE HTML>
<html>
<head>
    <include file="Public/head"/>
    <link href="__CSS__/home.css" type="text/css" rel="stylesheet">
    <php> D('Member')->need_login();</php>
</head>
<body>
<!-- 头部 -->
<div class="top-bar">
    <div class="top-bar-inner container">
        <div class="row">
            <div class="col-xs-3">
                <php>$logo = get_cover(modC('LOGO',0,'Home'),'path');
                    $logo = $logo?$logo:'__ROOT__/Public/images/logo.png';
                </php>

                <a class="logo" href="{:U('Home/Index/index')}"><img src="{$logo}"/></a>
            </div>
            <div class="col-xs-6">
                <p>
                    {:modC('SUMMARY','','Home')}
                </p>
            </div>
            <div class="just-look col-xs-3 text-right">
                <neq name="enter" value="">
                    <a href="{$enter}"><i class="icon-circle-blank"></i> 进入网站</a>
                </neq>
            </div>
        </div>

    </div>

</div>

<volist name="showBlocks" id="v">
    <php>if($v=='slider'){</php>
    <div class="carousel-bar margin-bottom-15" style="position: relative">
        <if condition="(modC('OPEN_LOGIN_PANEL',1,'Home') eq 1) AND (!is_login())">
            <div class="container login-wrapper">
                <form action="/index.php?s=/ucenter/member/login.html" method="post">
                    <div class="login-panel">
                        <h2>登陆</h2>

                        <div class="login-panel-body">

                            <p>

                            <div class="input-group">
                                <span class="input-group-addon"><i class="icon-user"></i></span>
                                <input type="text" class="form-control" name="username" placeholder="用户名">
                            </div>
                            </p>
                            <p>

                            <div class="input-group">
                                <span class="input-group-addon"><i class="icon-key"></i></span>
                                <input type="password" class="form-control" name="password" placeholder="密码">
                            </div>
                            </p>

                            <div class="row">
                                <div class="col-xs-6">
                                    <label><input type="checkbox" name="remember" value="1"> 自动登陆</label>
                                </div>
                                <div class="col-xs-6 text-right">
                                    <a href="{:U('Ucenter/Member/mi')}">忘记密码？</a>
                                </div>
                            </div>

                            <script type="text/javascript">
                                var quickLogin = "login";
                                $(document)
                                        .ajaxStart(function () {
                                            $("button:submit").addClass("log-in").attr("disabled", true);
                                        })
                                        .ajaxStop(function () {
                                            $("button:submit").removeClass("log-in").attr("disabled", false);
                                        });

                                function change_show(obj) {
                                    if ($(obj).text().trim() == 'show') {
                                        var value = $('#inputPassword').val().trim();
                                        var html = '<input type="text" value="' + value + '" id="inputPassword" class="form-control" placeholder="请输入密码" errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="password">' +
                                                '<div class="input-group-addon"><a style="width: 100%;height: 100%" href="javascript:void(0);" onclick="change_show(this)">hide</a></div>';
                                        $('#password_block').html(html);
                                    } else {
                                        var value = $('#inputPassword').val().trim();
                                        var html = '<input type="password" value="' + value + '" id="inputPassword" class="form-control" placeholder="请输入密码" errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="password">' +
                                                '<div class="input-group-addon"><a style="width: 100%;height: 100%" href="javascript:void(0);" onclick="change_show(this)">show</a></div>';
                                        $('#password_block').html(html);
                                    }
                                }

                                $(function () {
                                    $("form").submit(function () {
                                        toast.showLoading();
                                        var self = $(this);
                                        $.post(self.attr("action"), self.serialize(), success, "json");
                                        return false;
                                        function success(data) {
                                            if (data.status) {
                                                if (data.url == undefined && quickLogin == "quickLogin") {
                                                    $('[data-role="login_info"]').append(data.info);
                                                    toast.success('欢迎回来。', '温馨提示');
                                                    setTimeout(function () {
                                                        window.location.reload();
                                                    }, 1500);
                                                } else {
                                                    $('body').append(data.info);
                                                    toast.success('欢迎回来，页面正在跳转，请稍候。', '温馨提示');
                                                    setTimeout(function () {
                                                        window.location.href = data.url;
                                                    }, 1500);
                                                }
                                            } else {
                                                toast.error(data.info, '温馨提示');
                                                //self.find(".Validform_checktip").text(data.info);
                                                //刷新验证码
                                                $(".reloadverify").click();
                                            }
                                            toast.hideLoading();
                                        }
                                    });
                                    var verifyimg = $(".verifyimg").attr("src");
                                    $(".reloadverify").click(function () {
                                        if (verifyimg.indexOf('?') > 0) {
                                            $(".verifyimg").attr("src", verifyimg + '&random=' + Math.random());
                                        } else {
                                            $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/, '') + '?' + Math.random());
                                        }
                                    });
                                });
                            </script>
                            <p>
                                <button class="btn btn-primary btn-md btn-block" type="submit">登陆</button>
                            </p>
                            <p>

                            <div class="row">
                            <php>
                                $open_quick_login=modC('OPEN_QUICK_LOGIN', 0, 'USERCONFIG');
                                $register_type=modC('REGISTER_TYPE','normal','Invite');
                                $register_type=explode(',',$register_type);
                                $only_open_register=0;
                                if(in_array('invite',$register_type)&&!in_array('normal',$register_type)){
                                $only_open_register=1;
                                }
                            </php>
                            <script>
                                var OPEN_QUICK_LOGIN = "{$open_quick_login}";
                                var ONLY_OPEN_REGISTER="{$only_open_register}";
                            </script>
                                <div class="col-xs-6">
                                    <a data-role="do_register" data-url="{:U('Ucenter/Member/register')}">注册账号</a>
                                </div>

                                <div class="col-xs-6">
                                    <div class="text-right">

                                    </div>
                                </div>
                            </div>
                            <div style="">
                                {:hook('syncLogin')}
                            </div>
                            </p>
                        </div>
                    </div>
                </form>
            </div>
        </if>
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
                <if condition="modC('PIC2',0,'Home') neq 0">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                </if>
                <if condition="modC('PIC2',0,'Home') neq 0">
                    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                </if>
                <if condition="modC('PIC3',0,'Home') neq 0">
                    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                </if>
            </ol>
            <div class="carousel-inner">

                <if condition="modC('PIC1',0,'Home') neq 0">
                    <div class="item active">
                        <if condition="modC('URL1','','Home') neq ''">
                            <a href="{:modC('URL1','','Home')}" target="{:modC('TARGET1','_self','Home')}">
                        </if>
                        <img alt="First slide" src="{:get_cover(modC('PIC1',0,'Home'),'path')}">

                        <div class="carousel-caption">
                            <h3>{:modC('TITLE1','','Home')}</h3>
                        </div>
                        <if condition="modC('URL1','','Home') neq ''">
                            </a> </if>
                    </div>
                </if>

                <if condition="modC('PIC2',0,'Home') neq 0">
                    <div class="item ">
                        <if condition="modC('URL2','','Home') neq ''">
                            <a href="{:modC('URL2','','Home')}" target="{:modC('TARGET2','_self','Home')}">
                        </if>
                        <img alt="First slide" src="{:get_cover(modC('PIC2',0,'Home'),'path')}">

                        <div class="carousel-caption">
                            <h3>{:modC('TITLE2','','Home')}</h3>
                        </div>
                        <if condition="modC('URL2','','Home') neq ''">
                            </a>
                        </if>
                    </div>
                </if>
                <if condition="modC('PIC3',0,'Home') neq 0">
                    <div class="item ">
                        <if condition="modC('URL3','','Home') neq ''">
                            <a href="{:modC('URL3','','Home')}" target="{:modC('TARGET3','_self','Home')}"></if>
                        <img alt="First slide" src="{:get_cover(modC('PIC3',0,'Home'),'path')}">

                        <div class="carousel-caption">
                            <h3>{:modC('TITLE3','','Home')}</h3>
                        </div>
                        <if condition="modC('URL3','','Home') neq ''">
                            </a></if>
                    </div>
                </if>
            </div>
            <if condition="modC('PIC2',0,'Home') neq 0">
                <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
                    <span class="icon-chevron-left"></span>
                </a>
                <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
                    <span class="icon-chevron-right"></span>
                </a>
            </if>

        </div>
    </div>
    <php>}else{</php>
    {:W($v.'/HomeBlock/render')}
    <php>}</php>

</volist>

<!-- /头部 -->

<!-- 主体 -->

<!-- /主体 -->

<!-- 底部 -->
<include file="Public/footer"/>
<!-- /底部 -->
</body>
</html>